Validates image data for a data reference.
pascal ComponentResult GraphicsImportValidate (
GraphicsImportComponent ci,
Boolean *valid)
The GraphicsImportValidate functions allows a graphics importer component to determine if its current data reference contains valid image data. For example, a JFIF graphics importer component might check for the presence of a JFIF marker in the data reference. This function is provided for applications to use to determine what type of image data a particular file may contain. Sometimes a file may not have the correct file type or file extension. In this case, the application will not know which graphics importer component to use. By iterating through all graphics importer components and calling GraphicsImportValidate for each one, it may be possible to locate a graphics importer component that can draw the specified file.
Not all graphics importer components implement this function. A component that does not implement the function will return the badComponentSelector result code. This does not indicate that the file is valid or invalid.
extern pascal ComponentResult GraphicsImportReadData (
GraphicsImportComponent ci,
void *dataPtr,
unsigned long dataOffset,
unsigned long dataSize);
GraphicsImportReadData communicates with the appropriate data handler to retrieve image data. Typically only developers of graphics importer components will need to use this function. This function should always be used to retrieve data from the data source, rather than reading it directly.